from typing import List


class Solution:
    def numOfStrings(self, patterns: List[str], word: str) -> int:
        ans = 0
        for pattern in patterns:
            if pattern in word:
                ans += 1
        return ans


if __name__ == "__main__":
    print(Solution().numOfStrings(patterns=["a", "abc", "bc", "d"], word="abc"))
    print(Solution().numOfStrings(patterns=["a", "b", "c"], word="aaaaabbbbb"))
    print(Solution().numOfStrings(patterns=["a", "a", "a"], word="ab"))
